<?php
my_component_load('testing' , false);
my_component_load('paging' , false);
my_component_load('alamat' , false); 
my_component_load('pr_potongan_limit_karyawan');
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0; 
$pot_id = isset( $_GET['pot_id'] ) ? $_GET['pot_id']:  0;
if($task == "edit"){  
	$pagename = ($id > 0 ) ? "Perubahan Data" : "Tambah Data";
	facebox_page('index.php?com=pr_potongan_limit_karyawan&task=edit_page&id='.$id.'&pot_id='.$pot_id , $pagename , 290	);
 
}elseif($task == "edit_page"){  
	if($_SERVER['REQUEST_METHOD'] == "POST"){
		submit_potongan_limit($id,$pot_id);
		$content = "Updated";
	}else{
		$content = form_potongan_limit($id,$pot_id);
	}
	generate_my_web($content, '' ,"plain.php");
	exit;

}elseif($id > 0){
	$pagename = "Detail potongan limit waktu karyawan";
	load_facebox_script();
	$content =display_data_potongan_by_karyawan_id($id);

}else{
	$pagename = "Daftar karyawan";
		load_facebox_script();
	$content =list_data_karyawan();
}
generate_my_web($content, $pagename  );